<SCRIPT language=JavaScript>
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
</SCRIPT>
<style type="text/css">
<!--
@import url("../estilo.css");
-->
</style>
<?PHP include("config.php");
require_once "sql_inject.php"; 
$bDestroy_session = TRUE; 
$url_redirect = 'index.php'; 
$sqlinject = new sql_inject('./log_file_sql.log',$bDestroy_session,$url_redirect)  ; 

$sqlinject->test($msquery); 
?>
<title>==Painel de Controle== [Mu Duel]</title><head>
<style type=text/css>
body{
scrollbar-face-color:#0066FF; 
scrollbar-highlight-color:#0066FF; 
scrollbar-3dlight-color:#0066FF; 
scrollbar-darkshadow-color:#000000; 
scrollbar-shadow-color:333333; 
scrollbar-arrow-color:0099FF; 
scrollbar-track-color:#000000;
font-family:Arial;
font-size:2;
}
.forms {font-family:arial;
font-size:12px;
font-family:Arial;
background-color:#222222;
color:#DDDDDD;
font-weight:bold;
border:1 solid #FFFFFF}
a {
color:#B30000;
text-decoration: none;
}
a:hover {
color:#FFFFFF;
text-decoration: underline; 
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="#000000" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center"></div>
<p><br>
  <br>
  <br>
  <br>
</p>
<p>&nbsp;</p>
<table width="500" height="412" border="0" align="center" cellpadding="2" cellspacing="2" bordercolor="#CCCCCC" bgcolor="#000000">
  <tr><td width="33%" height="408" align="center" valign="top"><p align="center"> 
        <?php if ((isset($_COOKIE['login'])) AND (isset($_COOKIE['pass']))) {
$login = $_COOKIE['login'];
$senha = $_COOKIE['pass'];
$sql = "SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login' AND memb__pwd='$senha'";
$sqlinject->test($sql); 
$sql = mssql_query($sql); 
$logado = mssql_num_rows($sql);
if ($logado <= 0) {
echo '<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><div align="justify"><font size="2" face="Courier New, Courier, mono">
Area Acessecivel Apenas Para Usuarios Logados<BR><BR><BR><BR></div></td></tr>
<tr><td height="25" valign="top"><div align="center"><font color="#B30000" size="4" face="Courier New, Courier, mono"><strong>ACESSO USU&Aacute;RIOS </strong></font></div></td>
</tr><tr><td><form name="form1" method="post" action="logar.php">
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
<tr><td><div align="right"><strong><font color="#B30000" size="3" face="Courier New, Courier, mono">Login:</font></strong></div></td>
<td><span class="style13"><INPUT name=login class="forms" id="login" size=15 maxLength=15>
</span></td></tr><tr><td><div align="right"><strong><font color="#B30000" size="3" face="Courier New, Courier, mono">Senha:</font></strong></div></td>
<td><span class="style11 style14"><INPUT name=senha type=password class="forms" id="senha" size=15 maxLength=15>
</span></td></tr><tr><td><div align="right"></div></td><td><span class="style13">
<input name="cria" type="submit" class="forms" id="cria" value="ENTRAR"></td></tr></table>
</form></td></tr><tr><td>&nbsp;</td></tr></table>';
exit(); } 

echo '<table width="100%"  border="0" cellspacing="7" cellpadding="0"><tr>
<td align="right" valign="middle"><div align="center"><font color="#FFFFFF" size="3" face="Courier New"><strong>Ol&aacute; ';
	echo $_COOKIE["nome"];
	echo '!</div><br></td>
  </tr><tr>
    <td align="right" valign="middle"><a href="manager.php"><font size="2" face="Courier New"><strong>Minha Conta</a></td>
  </tr><tr>
    <td align="right" valign="middle"><a href="mudasenha.php"><font size="2" face="Courier New"><strong>Mudar Senha</a></td>
  </tr>    <tr>
    <td align="right" valign="middle"><a href="pontos.php"><font size="2" face="Courier New"><strong>Distribuir Pontos</a></td>
  </tr><tr>
    <td align="right" valign="middle"><a href="pk.php"><font size="2" face="Courier New"><strong>Limpar PK</a></td>
  </tr><tr>
    <td align="right" valign="middle"><a href="logout.php"><font size="2" face="Courier New"><strong>Sair</a></td>
  </tr></table>';
} else {
echo '<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><div align="center"><font size="2" face="Courier New, Courier, mono" color="#B30000">
<BR><BR>Area Assesivel Apenas Para Usuarios Logados<BR>Loge-se e Diverta-se<BR><BR><BR></div></td></tr>
<tr><td height="25" valign="top"><div align="center"><font color="#B30000" size="4" face="Courier New, Courier, mono"><strong>Painel do Usuario</strong></font></div></td>
</tr><tr><td><form name="form1" method="post" action="logar.php">
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
<tr><td><div align="right"><strong><font color="#B30000" size="3" face="Courier New, Courier, mono">Login:</font></strong></div></td>
<td><span class="style13"><INPUT name=login class="forms" id="login" size=15 maxLength=15>
</span></td></tr><tr><td><div align="right"><strong><font color="#B30000" size="3" face="Courier New, Courier, mono">Senha:</font></strong></div></td>
<td><span class="style11 style14"><INPUT name=pass type=password class="forms" id="pass" size=15 maxLength=15>
</span></td></tr><tr><td><div align="right"></div></td><td><span class="style13">
<input name="cria" type="submit" class="forms" id="cria" value="Entrar"></td></tr></table>
</form></td></tr><tr><td>&nbsp;</td></tr></table>';
exit(); } ?>
      </p>
      <p align="center">&nbsp;</p></td><td width="67%" align="center" valign="top"><div align="center"> 
        <?php
	
	if (empty($_POST['atual'])) {
	echo '<form action="" method="post" name="mudasenha" id="mudasenha">
      <p><strong><font color="#FFFFFF" size="1" face="Verdana">Altera&ccedil;&atilde;o de Senha </font></strong></p>
      <BR><BR><table width="100%"  border="0" align="center" cellpadding="3" cellspacing="3">
    <tr>
      <td width="50%"><div align="right"><font size=2><font size=2><font color="#FFFFFF">Digite sua senha atual: </div></td>
      <td width="50%"><div align="left">
          <input name="atual" type="password" class="forms" id="atual2" size="10" maxlength="10">
      </div></td>
    </tr>
    <tr>
      <td width="50%"><div align="right"><font size=2><font color="#FFFFFF">Digite a nova senha: </div></td>
      <td width="50%"><div align="left">
          <input name="nova" type="password" class="forms" id="nova3" size="10" maxlength="10">
      </div></td>
    </tr>
    <tr>
      <td width="50%"><div align="right"><font size=2><font size=2><font color="#FFFFFF">Confirme a  nova senha: </div></td>
      <td width="50%"><input name="nova2" type="password" class="forms" id="nova22" size="10" maxlength="10"></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input name="Submit" type="submit" class="forms" value="Alterar Senha"></td>
    </tr>
  </table>
</form>'; }
else {
echo '<p><strong><font color="#006699" size="1" face="Verdana">Altera&ccedil;&atilde;o de Senha </font></strong></p>';
$login = stripslashes($_COOKIE['login']);
$login = htmlspecialchars($login,ENT_QUOTES);
$pssenha = stripslashes($_POST['atual']);
$senha = htmlspecialchars($pssenha,ENT_QUOTES);
$psnovasenha = stripslashes($_POST['nova']);	
$novasenha = htmlspecialchars($psnovasenha,ENT_QUOTES);
$psnovasenha2 = stripslashes($_POST['nova2']);	
$novasenha2 = htmlspecialchars($psnovasenha2,ENT_QUOTES);
$sql_username_check = "SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login' and memb__pwd = '$senha'";
$sqlinject->test($sql_username_check);
$sql_username_check = mssql_query($sql_username_check); 
$username_check = mssql_num_rows($sql_username_check);
if (empty($novasenha) || empty($novasenha2) || ($username_check <= 0) || ($novasenha != $novasenha2)) {
    echo "Erro: <br>";
if (empty($novasenha) || empty($novasenha2)) {
    echo "Preencha TODOS os campos! <br>";}
elseif ($username_check <= 0){ 
        echo "A senha atual está incorreta. Volte e tente novamente corrija.<br>"; }
elseif ($novasenha != $novasenha2) {
	echo "Para alterar a senha, é necessário que a nova senha seja confirmada. Digite a mesma coisa 
	no campo nova senha e no campo confirme nova senha!";}
}
else {	
$sql = mssql_query("UPDATE dbo.MEMB_INFO
SET memb__pwd = '$novasenha'
WHERE memb___id = '$login'");
echo "Sua senha foi alterada com sucesso.<br>
      N&Atilde;O ESQUE&Ccedil;A SUA NOVA SENHA!!!<br>";}}
	  function anti_injection($sql)
{
	// remove palavras que contenham sintaxe sql
	$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
	$sql = trim($sql);//limpa espaços vazio
	$sql = strip_tags($sql);//tira tags html e php
	$sql = addslashes($sql);//Adiciona barras invertidas a uma string
	return $sql;
}
?>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
      </div></td>
</tr></table>
</body></html>